package org.anderground.editor.gui.properties.transfer;

import org.anderground.core.model.Transfer;
import org.anderground.editor.edits.EditsManager;
import org.anderground.editor.edits.SetTransitionTimeAction;

public class TransferTimeProperty extends AbstractStringTransferProperty {

	@Override
	public String getPropertyName() {
		return "Time";
	}

	@Override
	public boolean isEditable() {
		return true;
	}

	@Override
	protected String getValue(Transfer transfer) {
		return transfer.getTime() + "";
	}

	@Override
	protected void setValue(Transfer transfer, String cellEditorValue) {
		EditsManager.getInstance().performAction(
				new SetTransitionTimeAction(transfer, Integer
						.parseInt(cellEditorValue)));
	}

}
